package com.aos.erp.manager.model.dsc.vo;

import com.aos.erp.manager.enums.DscTimeType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("驾校合同查询条件")
public class DscConditionVo implements Serializable {

    @ApiModelProperty(value = "每页查询数量", dataType = "Integer")
    private int pageSize = 20;
    @ApiModelProperty(value = "当前页码", dataType = "Integer")
    private int pageIndex = 1;

    @ApiModelProperty(hidden = true, value = "合同编号")
    private String dscCode="";
    @ApiModelProperty(hidden = true, value = "合同名称")
    private String dscName="";
    @ApiModelProperty(hidden = true, value = "客户名称")
    private String dscCustomerName="";
    @ApiModelProperty(hidden = true, value = "签订人")
    private String dscSignName="";
    @ApiModelProperty(hidden = true, value = "合同时间类型：dsc_start 为 合同开始时间；dsc_end 为 合同截止时间")
    private DscTimeType timeType = DscTimeType.dsc_sign;
    @ApiModelProperty(value = "开始时间", hidden = true)
    private String fromTime="";
    @ApiModelProperty(value = "截止时间", hidden = true)
    private String toTime="";

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(int pageIndex) {
        this.pageIndex = pageIndex;
    }

    public String getDscCode() {
        return dscCode;
    }

    public void setDscCode(String dscCode) {
        this.dscCode = dscCode;
    }

    public String getDscName() {
        return dscName;
    }

    public void setDscName(String dscName) {
        this.dscName = dscName;
    }

    public String getDscCustomerName() {
        return dscCustomerName;
    }

    public void setDscCustomerName(String dscCustomerName) {
        this.dscCustomerName = dscCustomerName;
    }

    public String getDscSignName() {
        return dscSignName;
    }

    public void setDscSignName(String dscSignName) {
        this.dscSignName = dscSignName;
    }

    public DscTimeType getTimeType() {
        return timeType;
    }

    public void setTimeType(DscTimeType timeType) {
        this.timeType = timeType;
    }

    public String getFromTime() {
        if(fromTime.length() > 0 && fromTime.length() == 10) {
            fromTime = fromTime + " 00:00:00";
        }
        return fromTime;
    }

    public void setFromTime(String fromTime) {
        this.fromTime = fromTime;
    }

    public String getToTime() {
        if(toTime.length() > 0 && toTime.length() == 10) {
            toTime = toTime + " 23:59:59";
        }
        return toTime;
    }

    public void setToTime(String toTime) {
        this.toTime = toTime;
    }
}
